const http = require('http')
const path=require('path')
const fs=require('fs')
const { log } = require('console')
const server=http.createServer((req,res)=>{
    let filepath= path.resolve(__dirname,'www',req.url)
    if(fs.existsSync(filepath)){// 判断路径是否有对应的文件
        const stats=fs.statSync(filepath)
    }
})

server.listen(8080,()=>{
    console.log('server is running at http://127.0.0.1:3000');
})
